import instance from '../utils/request'

export function searchPage(searchParams) {
    return instance.get("/GiftInfo/getGift",{params:searchParams});
}

export function searchGiftPage(searchGiftParams) {
    return instance.get("/GiftInfo/getGift",{params:searchGiftParams});
}

export function searchColors() {
    return instance.get("/GiftInfo/getColor");
}

export function searchBrands() {
    return instance.get("/GiftInfo/getBrand");
}

export function searchTypes() {
    return instance.get("/GiftInfo/getType");
}
export function saveGift(giftInfo) {
        return instance.post(`/GiftInfo/addGift`,giftInfo);
}
export function updateGift(giftInfo) {
        return instance.put(`/GiftInfo/editGift`,giftInfo);
}
export function deleteById(giftId) {
    return instance.delete(`/GiftInfo/deleteById/${giftId}`);
}

//赠品转商品
export function searchGiftGoodPage(searchParams) {
    return instance.get("/GiftGood/getGiftGood",{params:searchParams});
}

export function searchGoodsPage(searchParams) {
    return instance.get("/Goods/getGoods",{params:searchParams});
}


export function searchGiftGoodColors() {
    return instance.get("/GiftGood/getGiftGoodColor");
}

export function searchGiftGoodBrands() {
    return instance.get("/GiftGood/getGiftGoodBrand");
}



export function searchGiftGoodTypes() {
    return instance.get("/GiftGood/getGiftGoodType");
}
export function searchGiftGoodCheck() {
    return instance.get("/GiftGood/getGiftGoodCheck");
}
export function saveGiftGood(giftGood) {
    return instance.post(`/GiftGood/addGiftGood`,giftGood);
}
export function updateGiftGood(giftGood) {
    return instance.put(`/GiftGood/editGiftGood`,giftGood);
}
export function deleteGiftGoodById(giftGoodid) {
    return instance.delete(`/GiftGood/deleteGiftGoodById/${giftGoodid}`);
}



//商品转赠品
export function searchGoodsGiftPage(searchParams) {
    return instance.get("/GoodsGift/getGoodsGift",{params:searchParams});
}
export function updateGood(goods) {
    return instance.put(`/Goods/editGood`,goods);
}

export function searchGoodsGiftColors() {
    return instance.get("/GoodsGift/getGoodsGiftColor");
}

export function searchGoodsGiftBrands() {
    return instance.get("/GoodsGift/getGoodsGiftBrand");
}

export function searchGoodsGiftTypes() {
    return instance.get("/GoodsGift/getGoodsGiftType");
}
export function searchGoodsGiftCheck() {
    return instance.get("/GoodsGift/getGoodsGiftCheck");
}
export function saveGoodsGift(goodsGift) {
    return instance.post(`/GoodsGift/addGoodsGift`,goodsGift);
}
export function updateGoodsGift(goodsGift) {
    return instance.put(`/GoodsGift/editGoodsGift`,goodsGift);
}
export function deleteGoodsGiftById(goodGiftid) {
    return instance.delete(`/GoodsGift/deleteGoodsGiftById/${goodGiftid}`);
}




//赠品绑定
export function searchGiftBindPage(searchParams) {
    return instance.get("/GiftBind/getGiftBind",{params:searchParams});
}

export function deleteBindById(bindId) {
    return instance.delete(`/GiftBind/deleteBindById/${bindId}`);
}
export function getGiftBindList(bindParams) {
    return instance.get("/GiftBind/getGiftBindListById",{params:bindParams});
}

export function searchGoodListPage(searchGListParams) {
    return instance.get("/Goods/getGoods",{params:searchGListParams});
}


export function getGoodBindList(bindParams) {
    return instance.get("/GiftBind/getGoodBindListById",{params:bindParams});
}

export function deleteBindGiftList(bindId) {
    return instance.delete(`/GiftBind/deleteBindGiftList/${bindId}`);
}

export function addBindGiftList(bindGiftList) {
    return instance.post(`/GiftBind/addBindGiftList`,bindGiftList);
}

export function deleteBindGoodList(bindId) {
    return instance.delete(`/GiftBind/deleteBindGoodList/${bindId}`);
}

export function addBindGoodList(bindGoodList) {
    return instance.post(`/GiftBind/addBindGoodList`,bindGoodList);
}
